/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.example.principal;

import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;

/**
 *
 * @author
 * AndresP
 */
public class InternetHelper {

    public static boolean checkInternetConnection(Context ctx) {
    	
    	  ConnectivityManager cm = (ConnectivityManager) ctx.getSystemService(Context.CONNECTIVITY_SERVICE);

          if (cm.getActiveNetworkInfo() != null && cm.getActiveNetworkInfo().isAvailable() && cm.getActiveNetworkInfo().isConnected()) {
              return true;

          } else {
              return false;
          }
    }
}
